Electronic compasses are commonly used in vehicles as an aid for direction finding and navigation. An electronic compass may be positioned in a vehicle on the instrument panel, the rearview mirror, in an overhead console, or at other locations within the vehicle. Typically, changes in the vehicle's magnetic field can cause erroneous compass displays. An electronic compass mounted in a vehicle will detect a variety of magnetic disturbances that can effect the compass reading. For example, a compass mounted in an instrument panel of a vehicle may detect interfering magnetic fields caused by various vehicle subsystems such as the motor for the vehicle HVAC system, an audio system, stepper motors for instrument panel gauges, front window defroster, etc. A compass mounted near the trunk of the vehicle (e.g., the rear package tray) may be affected by a disturbance caused by a rear window defroster. A compass mounted in an overhead console may be affected by subsystems in close proximity to the magnetic sensors of the electronic compass. The vehicle's magnetism may also be affected when, for example, a vehicle door or other closure member such as a trunk, hood, tailgate, etc. is opened while the vehicle is stopped.
Another source of magnetic disturbances in a vehicle that can cause errors in a compass reading is a moveable vehicle accessory such as a sunroof, a seat or a convertible top. For example, the measurement of an electronic compass mounted in an overhead console of a vehicle, or other appropriate location, may be affected by the operation of a sunroof (e.g., as the sunroof moves between various positions or the type of position of the sunroof such as partially open, fully closed, etc.). Therefore, a need exists for a system and method for compensating for magnetic disturbance caused by a moveable vehicle accessory.